import 'package:seedfour/generated/json/base/json_convert_content.dart';
import 'package:seedfour/app/models/user_statistics_entity.dart';

UserStatisticsEntity $UserStatisticsEntityFromJson(Map<String, dynamic> json) {
  final UserStatisticsEntity userStatisticsEntity = UserStatisticsEntity();
  final UserStatisticsSumYear? sumYear = jsonConvert.convert<
      UserStatisticsSumYear>(json['sumYear']);
  if (sumYear != null) {
    userStatisticsEntity.sumYear = sumYear;
  }
  final UserStatisticsCurMonth? curMonth = jsonConvert.convert<
      UserStatisticsCurMonth>(json['curMonth']);
  if (curMonth != null) {
    userStatisticsEntity.curMonth = curMonth;
  }
  final UserStatisticsLastMonth? lastMonth = jsonConvert.convert<
      UserStatisticsLastMonth>(json['lastMonth']);
  if (lastMonth != null) {
    userStatisticsEntity.lastMonth = lastMonth;
  }
  final UserStatisticsIncomeData? incomeData = jsonConvert.convert<
      UserStatisticsIncomeData>(json['incomeData']);
  if (incomeData != null) {
    userStatisticsEntity.incomeData = incomeData;
  }
  final UserStatisticsExpendData? expendData = jsonConvert.convert<
      UserStatisticsExpendData>(json['expendData']);
  if (expendData != null) {
    userStatisticsEntity.expendData = expendData;
  }
  final UserStatisticsAllocData? allocData = jsonConvert.convert<
      UserStatisticsAllocData>(json['allocData']);
  if (allocData != null) {
    userStatisticsEntity.allocData = allocData;
  }
  final UserStatisticsUserBalanceList? userBalanceList = jsonConvert.convert<
      UserStatisticsUserBalanceList>(json['userBalanceList']);
  if (userBalanceList != null) {
    userStatisticsEntity.userBalanceList = userBalanceList;
  }
  final UserStatisticsCcList? ccList = jsonConvert.convert<
      UserStatisticsCcList>(json['ccList']);
  if (ccList != null) {
    userStatisticsEntity.ccList = ccList;
  }
  final String? incomeAmount = jsonConvert.convert<String>(
      json['incomeAmount']);
  if (incomeAmount != null) {
    userStatisticsEntity.incomeAmount = incomeAmount;
  }
  final String? allocAmount = jsonConvert.convert<String>(json['allocAmount']);
  if (allocAmount != null) {
    userStatisticsEntity.allocAmount = allocAmount;
  }
  final String? expendAmount = jsonConvert.convert<String>(
      json['expendAmount']);
  if (expendAmount != null) {
    userStatisticsEntity.expendAmount = expendAmount;
  }
  return userStatisticsEntity;
}

Map<String, dynamic> $UserStatisticsEntityToJson(UserStatisticsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['sumYear'] = entity.sumYear?.toJson();
  data['curMonth'] = entity.curMonth?.toJson();
  data['lastMonth'] = entity.lastMonth?.toJson();
  data['incomeData'] = entity.incomeData?.toJson();
  data['expendData'] = entity.expendData?.toJson();
  data['allocData'] = entity.allocData?.toJson();
  data['userBalanceList'] = entity.userBalanceList?.toJson();
  data['ccList'] = entity.ccList?.toJson();
  data['incomeAmount'] = entity.incomeAmount;
  data['allocAmount'] = entity.allocAmount;
  data['expendAmount'] = entity.expendAmount;
  return data;
}

extension UserStatisticsEntityExtension on UserStatisticsEntity {
  UserStatisticsEntity copyWith({
    UserStatisticsSumYear? sumYear,
    UserStatisticsCurMonth? curMonth,
    UserStatisticsLastMonth? lastMonth,
    UserStatisticsIncomeData? incomeData,
    UserStatisticsExpendData? expendData,
    UserStatisticsAllocData? allocData,
    UserStatisticsUserBalanceList? userBalanceList,
    UserStatisticsCcList? ccList,
    String? incomeAmount,
    String? allocAmount,
    String? expendAmount,
  }) {
    return UserStatisticsEntity()
      ..sumYear = sumYear ?? this.sumYear
      ..curMonth = curMonth ?? this.curMonth
      ..lastMonth = lastMonth ?? this.lastMonth
      ..incomeData = incomeData ?? this.incomeData
      ..expendData = expendData ?? this.expendData
      ..allocData = allocData ?? this.allocData
      ..userBalanceList = userBalanceList ?? this.userBalanceList
      ..ccList = ccList ?? this.ccList
      ..incomeAmount = incomeAmount ?? this.incomeAmount
      ..allocAmount = allocAmount ?? this.allocAmount
      ..expendAmount = expendAmount ?? this.expendAmount;
  }
}

UserStatisticsSumYear $UserStatisticsSumYearFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsSumYear userStatisticsSumYear = UserStatisticsSumYear();
  final String? incomeTotal = jsonConvert.convert<String>(json['incomeTotal']);
  if (incomeTotal != null) {
    userStatisticsSumYear.incomeTotal = incomeTotal;
  }
  final String? expendTotal = jsonConvert.convert<String>(json['expendTotal']);
  if (expendTotal != null) {
    userStatisticsSumYear.expendTotal = expendTotal;
  }
  final String? incomeMonthRate = jsonConvert.convert<String>(
      json['incomeMonthRate']);
  if (incomeMonthRate != null) {
    userStatisticsSumYear.incomeMonthRate = incomeMonthRate;
  }
  final String? expendMonthRate = jsonConvert.convert<String>(
      json['expendMonthRate']);
  if (expendMonthRate != null) {
    userStatisticsSumYear.expendMonthRate = expendMonthRate;
  }
  final String? allocTotal = jsonConvert.convert<String>(json['allocTotal']);
  if (allocTotal != null) {
    userStatisticsSumYear.allocTotal = allocTotal;
  }
  final String? allocMonthRate = jsonConvert.convert<String>(
      json['allocMonthRate']);
  if (allocMonthRate != null) {
    userStatisticsSumYear.allocMonthRate = allocMonthRate;
  }
  final String? rtEffect = jsonConvert.convert<String>(json['rtEffect']);
  if (rtEffect != null) {
    userStatisticsSumYear.rtEffect = rtEffect;
  }
  return userStatisticsSumYear;
}

Map<String, dynamic> $UserStatisticsSumYearToJson(
    UserStatisticsSumYear entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['incomeTotal'] = entity.incomeTotal;
  data['expendTotal'] = entity.expendTotal;
  data['incomeMonthRate'] = entity.incomeMonthRate;
  data['expendMonthRate'] = entity.expendMonthRate;
  data['allocTotal'] = entity.allocTotal;
  data['allocMonthRate'] = entity.allocMonthRate;
  data['rtEffect'] = entity.rtEffect;
  return data;
}

extension UserStatisticsSumYearExtension on UserStatisticsSumYear {
  UserStatisticsSumYear copyWith({
    String? incomeTotal,
    String? expendTotal,
    String? incomeMonthRate,
    String? expendMonthRate,
    String? allocTotal,
    String? allocMonthRate,
    String? rtEffect,
  }) {
    return UserStatisticsSumYear()
      ..incomeTotal = incomeTotal ?? this.incomeTotal
      ..expendTotal = expendTotal ?? this.expendTotal
      ..incomeMonthRate = incomeMonthRate ?? this.incomeMonthRate
      ..expendMonthRate = expendMonthRate ?? this.expendMonthRate
      ..allocTotal = allocTotal ?? this.allocTotal
      ..allocMonthRate = allocMonthRate ?? this.allocMonthRate
      ..rtEffect = rtEffect ?? this.rtEffect;
  }
}

UserStatisticsCurMonth $UserStatisticsCurMonthFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsCurMonth userStatisticsCurMonth = UserStatisticsCurMonth();
  final String? incomeTotal = jsonConvert.convert<String>(json['incomeTotal']);
  if (incomeTotal != null) {
    userStatisticsCurMonth.incomeTotal = incomeTotal;
  }
  final String? expendTotal = jsonConvert.convert<String>(json['expendTotal']);
  if (expendTotal != null) {
    userStatisticsCurMonth.expendTotal = expendTotal;
  }
  final String? incomeMonthRate = jsonConvert.convert<String>(
      json['incomeMonthRate']);
  if (incomeMonthRate != null) {
    userStatisticsCurMonth.incomeMonthRate = incomeMonthRate;
  }
  final String? incomeYearRate = jsonConvert.convert<String>(
      json['incomeYearRate']);
  if (incomeYearRate != null) {
    userStatisticsCurMonth.incomeYearRate = incomeYearRate;
  }
  final String? expendMonthRate = jsonConvert.convert<String>(
      json['expendMonthRate']);
  if (expendMonthRate != null) {
    userStatisticsCurMonth.expendMonthRate = expendMonthRate;
  }
  final String? expendYearRate = jsonConvert.convert<String>(
      json['expendYearRate']);
  if (expendYearRate != null) {
    userStatisticsCurMonth.expendYearRate = expendYearRate;
  }
  final String? allocTotal = jsonConvert.convert<String>(json['allocTotal']);
  if (allocTotal != null) {
    userStatisticsCurMonth.allocTotal = allocTotal;
  }
  final String? allocMonthRate = jsonConvert.convert<String>(
      json['allocMonthRate']);
  if (allocMonthRate != null) {
    userStatisticsCurMonth.allocMonthRate = allocMonthRate;
  }
  final String? allocYearRate = jsonConvert.convert<String>(
      json['allocYearRate']);
  if (allocYearRate != null) {
    userStatisticsCurMonth.allocYearRate = allocYearRate;
  }
  final String? monthEffect = jsonConvert.convert<String>(json['monthEffect']);
  if (monthEffect != null) {
    userStatisticsCurMonth.monthEffect = monthEffect;
  }
  return userStatisticsCurMonth;
}

Map<String, dynamic> $UserStatisticsCurMonthToJson(
    UserStatisticsCurMonth entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['incomeTotal'] = entity.incomeTotal;
  data['expendTotal'] = entity.expendTotal;
  data['incomeMonthRate'] = entity.incomeMonthRate;
  data['incomeYearRate'] = entity.incomeYearRate;
  data['expendMonthRate'] = entity.expendMonthRate;
  data['expendYearRate'] = entity.expendYearRate;
  data['allocTotal'] = entity.allocTotal;
  data['allocMonthRate'] = entity.allocMonthRate;
  data['allocYearRate'] = entity.allocYearRate;
  data['monthEffect'] = entity.monthEffect;
  return data;
}

extension UserStatisticsCurMonthExtension on UserStatisticsCurMonth {
  UserStatisticsCurMonth copyWith({
    String? incomeTotal,
    String? expendTotal,
    String? incomeMonthRate,
    String? incomeYearRate,
    String? expendMonthRate,
    String? expendYearRate,
    String? allocTotal,
    String? allocMonthRate,
    String? allocYearRate,
    String? monthEffect,
  }) {
    return UserStatisticsCurMonth()
      ..incomeTotal = incomeTotal ?? this.incomeTotal
      ..expendTotal = expendTotal ?? this.expendTotal
      ..incomeMonthRate = incomeMonthRate ?? this.incomeMonthRate
      ..incomeYearRate = incomeYearRate ?? this.incomeYearRate
      ..expendMonthRate = expendMonthRate ?? this.expendMonthRate
      ..expendYearRate = expendYearRate ?? this.expendYearRate
      ..allocTotal = allocTotal ?? this.allocTotal
      ..allocMonthRate = allocMonthRate ?? this.allocMonthRate
      ..allocYearRate = allocYearRate ?? this.allocYearRate
      ..monthEffect = monthEffect ?? this.monthEffect;
  }
}

UserStatisticsLastMonth $UserStatisticsLastMonthFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsLastMonth userStatisticsLastMonth = UserStatisticsLastMonth();
  final String? incomeTotal = jsonConvert.convert<String>(json['incomeTotal']);
  if (incomeTotal != null) {
    userStatisticsLastMonth.incomeTotal = incomeTotal;
  }
  final String? expendTotal = jsonConvert.convert<String>(json['expendTotal']);
  if (expendTotal != null) {
    userStatisticsLastMonth.expendTotal = expendTotal;
  }
  final String? incomeMonthRate = jsonConvert.convert<String>(
      json['incomeMonthRate']);
  if (incomeMonthRate != null) {
    userStatisticsLastMonth.incomeMonthRate = incomeMonthRate;
  }
  final String? incomeYearRate = jsonConvert.convert<String>(
      json['incomeYearRate']);
  if (incomeYearRate != null) {
    userStatisticsLastMonth.incomeYearRate = incomeYearRate;
  }
  final String? expendMonthRate = jsonConvert.convert<String>(
      json['expendMonthRate']);
  if (expendMonthRate != null) {
    userStatisticsLastMonth.expendMonthRate = expendMonthRate;
  }
  final String? expendYearRate = jsonConvert.convert<String>(
      json['expendYearRate']);
  if (expendYearRate != null) {
    userStatisticsLastMonth.expendYearRate = expendYearRate;
  }
  final String? allocTotal = jsonConvert.convert<String>(json['allocTotal']);
  if (allocTotal != null) {
    userStatisticsLastMonth.allocTotal = allocTotal;
  }
  final String? allocMonthRate = jsonConvert.convert<String>(
      json['allocMonthRate']);
  if (allocMonthRate != null) {
    userStatisticsLastMonth.allocMonthRate = allocMonthRate;
  }
  final String? allocYearRate = jsonConvert.convert<String>(
      json['allocYearRate']);
  if (allocYearRate != null) {
    userStatisticsLastMonth.allocYearRate = allocYearRate;
  }
  final String? monthEffect = jsonConvert.convert<String>(json['monthEffect']);
  if (monthEffect != null) {
    userStatisticsLastMonth.monthEffect = monthEffect;
  }
  return userStatisticsLastMonth;
}

Map<String, dynamic> $UserStatisticsLastMonthToJson(
    UserStatisticsLastMonth entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['incomeTotal'] = entity.incomeTotal;
  data['expendTotal'] = entity.expendTotal;
  data['incomeMonthRate'] = entity.incomeMonthRate;
  data['incomeYearRate'] = entity.incomeYearRate;
  data['expendMonthRate'] = entity.expendMonthRate;
  data['expendYearRate'] = entity.expendYearRate;
  data['allocTotal'] = entity.allocTotal;
  data['allocMonthRate'] = entity.allocMonthRate;
  data['allocYearRate'] = entity.allocYearRate;
  data['monthEffect'] = entity.monthEffect;
  return data;
}

extension UserStatisticsLastMonthExtension on UserStatisticsLastMonth {
  UserStatisticsLastMonth copyWith({
    String? incomeTotal,
    String? expendTotal,
    String? incomeMonthRate,
    String? incomeYearRate,
    String? expendMonthRate,
    String? expendYearRate,
    String? allocTotal,
    String? allocMonthRate,
    String? allocYearRate,
    String? monthEffect,
  }) {
    return UserStatisticsLastMonth()
      ..incomeTotal = incomeTotal ?? this.incomeTotal
      ..expendTotal = expendTotal ?? this.expendTotal
      ..incomeMonthRate = incomeMonthRate ?? this.incomeMonthRate
      ..incomeYearRate = incomeYearRate ?? this.incomeYearRate
      ..expendMonthRate = expendMonthRate ?? this.expendMonthRate
      ..expendYearRate = expendYearRate ?? this.expendYearRate
      ..allocTotal = allocTotal ?? this.allocTotal
      ..allocMonthRate = allocMonthRate ?? this.allocMonthRate
      ..allocYearRate = allocYearRate ?? this.allocYearRate
      ..monthEffect = monthEffect ?? this.monthEffect;
  }
}

UserStatisticsIncomeData $UserStatisticsIncomeDataFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsIncomeData userStatisticsIncomeData = UserStatisticsIncomeData();
  final List<int>? value = (json['value'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (value != null) {
    userStatisticsIncomeData.value = value;
  }
  final List<int>? yearRate = (json['yearRate'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (yearRate != null) {
    userStatisticsIncomeData.yearRate = yearRate;
  }
  final List<int>? monthRate = (json['monthRate'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (monthRate != null) {
    userStatisticsIncomeData.monthRate = monthRate;
  }
  final List<int?>? monthEffect = (json['monthEffect'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e)).toList();
  if (monthEffect != null) {
    userStatisticsIncomeData.monthEffect = monthEffect;
  }
  return userStatisticsIncomeData;
}

Map<String, dynamic> $UserStatisticsIncomeDataToJson(
    UserStatisticsIncomeData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['value'] = entity.value;
  data['yearRate'] = entity.yearRate;
  data['monthRate'] = entity.monthRate;
  data['monthEffect'] = entity.monthEffect;
  return data;
}

extension UserStatisticsIncomeDataExtension on UserStatisticsIncomeData {
  UserStatisticsIncomeData copyWith({
    List<int>? value,
    List<int>? yearRate,
    List<int>? monthRate,
    List<int?>? monthEffect,
  }) {
    return UserStatisticsIncomeData()
      ..value = value ?? this.value
      ..yearRate = yearRate ?? this.yearRate
      ..monthRate = monthRate ?? this.monthRate
      ..monthEffect = monthEffect ?? this.monthEffect;
  }
}

UserStatisticsExpendData $UserStatisticsExpendDataFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsExpendData userStatisticsExpendData = UserStatisticsExpendData();
  final List<int>? value = (json['value'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (value != null) {
    userStatisticsExpendData.value = value;
  }
  final List<int>? yearRate = (json['yearRate'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (yearRate != null) {
    userStatisticsExpendData.yearRate = yearRate;
  }
  final List<int>? monthRate = (json['monthRate'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (monthRate != null) {
    userStatisticsExpendData.monthRate = monthRate;
  }
  return userStatisticsExpendData;
}

Map<String, dynamic> $UserStatisticsExpendDataToJson(
    UserStatisticsExpendData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['value'] = entity.value;
  data['yearRate'] = entity.yearRate;
  data['monthRate'] = entity.monthRate;
  return data;
}

extension UserStatisticsExpendDataExtension on UserStatisticsExpendData {
  UserStatisticsExpendData copyWith({
    List<int>? value,
    List<int>? yearRate,
    List<int>? monthRate,
  }) {
    return UserStatisticsExpendData()
      ..value = value ?? this.value
      ..yearRate = yearRate ?? this.yearRate
      ..monthRate = monthRate ?? this.monthRate;
  }
}

UserStatisticsAllocData $UserStatisticsAllocDataFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsAllocData userStatisticsAllocData = UserStatisticsAllocData();
  final List<int>? value = (json['value'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (value != null) {
    userStatisticsAllocData.value = value;
  }
  final List<int>? yearRate = (json['yearRate'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (yearRate != null) {
    userStatisticsAllocData.yearRate = yearRate;
  }
  final List<int>? monthRate = (json['monthRate'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (monthRate != null) {
    userStatisticsAllocData.monthRate = monthRate;
  }
  return userStatisticsAllocData;
}

Map<String, dynamic> $UserStatisticsAllocDataToJson(
    UserStatisticsAllocData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['value'] = entity.value;
  data['yearRate'] = entity.yearRate;
  data['monthRate'] = entity.monthRate;
  return data;
}

extension UserStatisticsAllocDataExtension on UserStatisticsAllocData {
  UserStatisticsAllocData copyWith({
    List<int>? value,
    List<int>? yearRate,
    List<int>? monthRate,
  }) {
    return UserStatisticsAllocData()
      ..value = value ?? this.value
      ..yearRate = yearRate ?? this.yearRate
      ..monthRate = monthRate ?? this.monthRate;
  }
}

UserStatisticsUserBalanceList $UserStatisticsUserBalanceListFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsUserBalanceList userStatisticsUserBalanceList = UserStatisticsUserBalanceList();
  final UserStatisticsUserBalanceListBalance? balance = jsonConvert.convert<
      UserStatisticsUserBalanceListBalance>(json['balance']);
  if (balance != null) {
    userStatisticsUserBalanceList.balance = balance;
  }
  final UserStatisticsUserBalanceListMargin? margin = jsonConvert.convert<
      UserStatisticsUserBalanceListMargin>(json['margin']);
  if (margin != null) {
    userStatisticsUserBalanceList.margin = margin;
  }
  final UserStatisticsUserBalanceListAlloc? alloc = jsonConvert.convert<
      UserStatisticsUserBalanceListAlloc>(json['alloc']);
  if (alloc != null) {
    userStatisticsUserBalanceList.alloc = alloc;
  }
  return userStatisticsUserBalanceList;
}

Map<String, dynamic> $UserStatisticsUserBalanceListToJson(
    UserStatisticsUserBalanceList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['balance'] = entity.balance?.toJson();
  data['margin'] = entity.margin?.toJson();
  data['alloc'] = entity.alloc?.toJson();
  return data;
}

extension UserStatisticsUserBalanceListExtension on UserStatisticsUserBalanceList {
  UserStatisticsUserBalanceList copyWith({
    UserStatisticsUserBalanceListBalance? balance,
    UserStatisticsUserBalanceListMargin? margin,
    UserStatisticsUserBalanceListAlloc? alloc,
  }) {
    return UserStatisticsUserBalanceList()
      ..balance = balance ?? this.balance
      ..margin = margin ?? this.margin
      ..alloc = alloc ?? this.alloc;
  }
}

UserStatisticsUserBalanceListBalance $UserStatisticsUserBalanceListBalanceFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsUserBalanceListBalance userStatisticsUserBalanceListBalance = UserStatisticsUserBalanceListBalance();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    userStatisticsUserBalanceListBalance.total = total;
  }
  final String? sumAmount = jsonConvert.convert<String>(json['sumAmount']);
  if (sumAmount != null) {
    userStatisticsUserBalanceListBalance.sumAmount = sumAmount;
  }
  final String? plusAmount = jsonConvert.convert<String>(json['plusAmount']);
  if (plusAmount != null) {
    userStatisticsUserBalanceListBalance.plusAmount = plusAmount;
  }
  final String? minusAmount = jsonConvert.convert<String>(json['minusAmount']);
  if (minusAmount != null) {
    userStatisticsUserBalanceListBalance.minusAmount = minusAmount;
  }
  final List<
      UserStatisticsUserBalanceListBalanceData>? data = (json['data'] as List<
      dynamic>?)?.map(
          (e) =>
      jsonConvert.convert<UserStatisticsUserBalanceListBalanceData>(
          e) as UserStatisticsUserBalanceListBalanceData).toList();
  if (data != null) {
    userStatisticsUserBalanceListBalance.data = data;
  }
  return userStatisticsUserBalanceListBalance;
}

Map<String, dynamic> $UserStatisticsUserBalanceListBalanceToJson(
    UserStatisticsUserBalanceListBalance entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['sumAmount'] = entity.sumAmount;
  data['plusAmount'] = entity.plusAmount;
  data['minusAmount'] = entity.minusAmount;
  data['data'] = entity.data?.map((v) => v.toJson()).toList();
  return data;
}

extension UserStatisticsUserBalanceListBalanceExtension on UserStatisticsUserBalanceListBalance {
  UserStatisticsUserBalanceListBalance copyWith({
    int? total,
    String? sumAmount,
    String? plusAmount,
    String? minusAmount,
    List<UserStatisticsUserBalanceListBalanceData>? data,
  }) {
    return UserStatisticsUserBalanceListBalance()
      ..total = total ?? this.total
      ..sumAmount = sumAmount ?? this.sumAmount
      ..plusAmount = plusAmount ?? this.plusAmount
      ..minusAmount = minusAmount ?? this.minusAmount
      ..data = data ?? this.data;
  }
}

UserStatisticsUserBalanceListBalanceData $UserStatisticsUserBalanceListBalanceDataFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsUserBalanceListBalanceData userStatisticsUserBalanceListBalanceData = UserStatisticsUserBalanceListBalanceData();
  final int? createdAt = jsonConvert.convert<int>(json['createdAt']);
  if (createdAt != null) {
    userStatisticsUserBalanceListBalanceData.createdAt = createdAt;
  }
  final String? amount = jsonConvert.convert<String>(json['amount']);
  if (amount != null) {
    userStatisticsUserBalanceListBalanceData.amount = amount;
  }
  final int? changeSubtype = jsonConvert.convert<int>(json['changeSubtype']);
  if (changeSubtype != null) {
    userStatisticsUserBalanceListBalanceData.changeSubtype = changeSubtype;
  }
  final String? afterBalance = jsonConvert.convert<String>(
      json['afterBalance']);
  if (afterBalance != null) {
    userStatisticsUserBalanceListBalanceData.afterBalance = afterBalance;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    userStatisticsUserBalanceListBalanceData.remark = remark;
  }
  final int? businessType = jsonConvert.convert<int>(json['businessType']);
  if (businessType != null) {
    userStatisticsUserBalanceListBalanceData.businessType = businessType;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    userStatisticsUserBalanceListBalanceData.title = title;
  }
  return userStatisticsUserBalanceListBalanceData;
}

Map<String, dynamic> $UserStatisticsUserBalanceListBalanceDataToJson(
    UserStatisticsUserBalanceListBalanceData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createdAt'] = entity.createdAt;
  data['amount'] = entity.amount;
  data['changeSubtype'] = entity.changeSubtype;
  data['afterBalance'] = entity.afterBalance;
  data['remark'] = entity.remark;
  data['businessType'] = entity.businessType;
  data['title'] = entity.title;
  return data;
}

extension UserStatisticsUserBalanceListBalanceDataExtension on UserStatisticsUserBalanceListBalanceData {
  UserStatisticsUserBalanceListBalanceData copyWith({
    int? createdAt,
    String? amount,
    int? changeSubtype,
    String? afterBalance,
    String? remark,
    int? businessType,
    String? title,
  }) {
    return UserStatisticsUserBalanceListBalanceData()
      ..createdAt = createdAt ?? this.createdAt
      ..amount = amount ?? this.amount
      ..changeSubtype = changeSubtype ?? this.changeSubtype
      ..afterBalance = afterBalance ?? this.afterBalance
      ..remark = remark ?? this.remark
      ..businessType = businessType ?? this.businessType
      ..title = title ?? this.title;
  }
}

UserStatisticsUserBalanceListMargin $UserStatisticsUserBalanceListMarginFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsUserBalanceListMargin userStatisticsUserBalanceListMargin = UserStatisticsUserBalanceListMargin();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    userStatisticsUserBalanceListMargin.total = total;
  }
  final String? sumAmount = jsonConvert.convert<String>(json['sumAmount']);
  if (sumAmount != null) {
    userStatisticsUserBalanceListMargin.sumAmount = sumAmount;
  }
  final String? plusAmount = jsonConvert.convert<String>(json['plusAmount']);
  if (plusAmount != null) {
    userStatisticsUserBalanceListMargin.plusAmount = plusAmount;
  }
  final String? minusAmount = jsonConvert.convert<String>(json['minusAmount']);
  if (minusAmount != null) {
    userStatisticsUserBalanceListMargin.minusAmount = minusAmount;
  }
  final List<
      UserStatisticsUserBalanceListMarginData>? data = (json['data'] as List<
      dynamic>?)?.map(
          (e) =>
      jsonConvert.convert<UserStatisticsUserBalanceListMarginData>(
          e) as UserStatisticsUserBalanceListMarginData).toList();
  if (data != null) {
    userStatisticsUserBalanceListMargin.data = data;
  }
  return userStatisticsUserBalanceListMargin;
}

Map<String, dynamic> $UserStatisticsUserBalanceListMarginToJson(
    UserStatisticsUserBalanceListMargin entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['sumAmount'] = entity.sumAmount;
  data['plusAmount'] = entity.plusAmount;
  data['minusAmount'] = entity.minusAmount;
  data['data'] = entity.data?.map((v) => v.toJson()).toList();
  return data;
}

extension UserStatisticsUserBalanceListMarginExtension on UserStatisticsUserBalanceListMargin {
  UserStatisticsUserBalanceListMargin copyWith({
    int? total,
    String? sumAmount,
    String? plusAmount,
    String? minusAmount,
    List<UserStatisticsUserBalanceListMarginData>? data,
  }) {
    return UserStatisticsUserBalanceListMargin()
      ..total = total ?? this.total
      ..sumAmount = sumAmount ?? this.sumAmount
      ..plusAmount = plusAmount ?? this.plusAmount
      ..minusAmount = minusAmount ?? this.minusAmount
      ..data = data ?? this.data;
  }
}

UserStatisticsUserBalanceListMarginData $UserStatisticsUserBalanceListMarginDataFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsUserBalanceListMarginData userStatisticsUserBalanceListMarginData = UserStatisticsUserBalanceListMarginData();
  final int? createdAt = jsonConvert.convert<int>(json['createdAt']);
  if (createdAt != null) {
    userStatisticsUserBalanceListMarginData.createdAt = createdAt;
  }
  final String? amount = jsonConvert.convert<String>(json['amount']);
  if (amount != null) {
    userStatisticsUserBalanceListMarginData.amount = amount;
  }
  final int? orderStatus = jsonConvert.convert<int>(json['orderStatus']);
  if (orderStatus != null) {
    userStatisticsUserBalanceListMarginData.orderStatus = orderStatus;
  }
  final dynamic marginDate = json['marginDate'];
  if (marginDate != null) {
    userStatisticsUserBalanceListMarginData.marginDate = marginDate;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    userStatisticsUserBalanceListMarginData.remark = remark;
  }
  return userStatisticsUserBalanceListMarginData;
}

Map<String, dynamic> $UserStatisticsUserBalanceListMarginDataToJson(
    UserStatisticsUserBalanceListMarginData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createdAt'] = entity.createdAt;
  data['amount'] = entity.amount;
  data['orderStatus'] = entity.orderStatus;
  data['marginDate'] = entity.marginDate;
  data['remark'] = entity.remark;
  return data;
}

extension UserStatisticsUserBalanceListMarginDataExtension on UserStatisticsUserBalanceListMarginData {
  UserStatisticsUserBalanceListMarginData copyWith({
    int? createdAt,
    String? amount,
    int? orderStatus,
    dynamic marginDate,
    String? remark,
  }) {
    return UserStatisticsUserBalanceListMarginData()
      ..createdAt = createdAt ?? this.createdAt
      ..amount = amount ?? this.amount
      ..orderStatus = orderStatus ?? this.orderStatus
      ..marginDate = marginDate ?? this.marginDate
      ..remark = remark ?? this.remark;
  }
}

UserStatisticsUserBalanceListAlloc $UserStatisticsUserBalanceListAllocFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsUserBalanceListAlloc userStatisticsUserBalanceListAlloc = UserStatisticsUserBalanceListAlloc();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    userStatisticsUserBalanceListAlloc.total = total;
  }
  final String? sumAmount = jsonConvert.convert<String>(json['sumAmount']);
  if (sumAmount != null) {
    userStatisticsUserBalanceListAlloc.sumAmount = sumAmount;
  }
  final String? plusAmount = jsonConvert.convert<String>(json['plusAmount']);
  if (plusAmount != null) {
    userStatisticsUserBalanceListAlloc.plusAmount = plusAmount;
  }
  final String? minusAmount = jsonConvert.convert<String>(json['minusAmount']);
  if (minusAmount != null) {
    userStatisticsUserBalanceListAlloc.minusAmount = minusAmount;
  }
  final List<dynamic>? data = (json['data'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (data != null) {
    userStatisticsUserBalanceListAlloc.data = data;
  }
  return userStatisticsUserBalanceListAlloc;
}

Map<String, dynamic> $UserStatisticsUserBalanceListAllocToJson(
    UserStatisticsUserBalanceListAlloc entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['sumAmount'] = entity.sumAmount;
  data['plusAmount'] = entity.plusAmount;
  data['minusAmount'] = entity.minusAmount;
  data['data'] = entity.data;
  return data;
}

extension UserStatisticsUserBalanceListAllocExtension on UserStatisticsUserBalanceListAlloc {
  UserStatisticsUserBalanceListAlloc copyWith({
    int? total,
    String? sumAmount,
    String? plusAmount,
    String? minusAmount,
    List<dynamic>? data,
  }) {
    return UserStatisticsUserBalanceListAlloc()
      ..total = total ?? this.total
      ..sumAmount = sumAmount ?? this.sumAmount
      ..plusAmount = plusAmount ?? this.plusAmount
      ..minusAmount = minusAmount ?? this.minusAmount
      ..data = data ?? this.data;
  }
}

UserStatisticsCcList $UserStatisticsCcListFromJson(Map<String, dynamic> json) {
  final UserStatisticsCcList userStatisticsCcList = UserStatisticsCcList();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    userStatisticsCcList.total = total;
  }
  final String? sumOrderAmount = jsonConvert.convert<String>(
      json['sumOrderAmount']);
  if (sumOrderAmount != null) {
    userStatisticsCcList.sumOrderAmount = sumOrderAmount;
  }
  final String? sumUserAmount = jsonConvert.convert<String>(
      json['sumUserAmount']);
  if (sumUserAmount != null) {
    userStatisticsCcList.sumUserAmount = sumUserAmount;
  }
  final List<UserStatisticsCcListData>? data = (json['data'] as List<dynamic>?)
      ?.map(
          (e) =>
      jsonConvert.convert<UserStatisticsCcListData>(
          e) as UserStatisticsCcListData)
      .toList();
  if (data != null) {
    userStatisticsCcList.data = data;
  }
  return userStatisticsCcList;
}

Map<String, dynamic> $UserStatisticsCcListToJson(UserStatisticsCcList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['sumOrderAmount'] = entity.sumOrderAmount;
  data['sumUserAmount'] = entity.sumUserAmount;
  data['data'] = entity.data?.map((v) => v.toJson()).toList();
  return data;
}

extension UserStatisticsCcListExtension on UserStatisticsCcList {
  UserStatisticsCcList copyWith({
    int? total,
    String? sumOrderAmount,
    String? sumUserAmount,
    List<UserStatisticsCcListData>? data,
  }) {
    return UserStatisticsCcList()
      ..total = total ?? this.total
      ..sumOrderAmount = sumOrderAmount ?? this.sumOrderAmount
      ..sumUserAmount = sumUserAmount ?? this.sumUserAmount
      ..data = data ?? this.data;
  }
}

UserStatisticsCcListData $UserStatisticsCcListDataFromJson(
    Map<String, dynamic> json) {
  final UserStatisticsCcListData userStatisticsCcListData = UserStatisticsCcListData();
  final int? createdAt = jsonConvert.convert<int>(json['createdAt']);
  if (createdAt != null) {
    userStatisticsCcListData.createdAt = createdAt;
  }
  final int? updatedAt = jsonConvert.convert<int>(json['updatedAt']);
  if (updatedAt != null) {
    userStatisticsCcListData.updatedAt = updatedAt;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    userStatisticsCcListData.id = id;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    userStatisticsCcListData.type = type;
  }
  final String? orgId = jsonConvert.convert<String>(json['orgId']);
  if (orgId != null) {
    userStatisticsCcListData.orgId = orgId;
  }
  final String? uid = jsonConvert.convert<String>(json['uid']);
  if (uid != null) {
    userStatisticsCcListData.uid = uid;
  }
  final String? taker = jsonConvert.convert<String>(json['taker']);
  if (taker != null) {
    userStatisticsCcListData.taker = taker;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    userStatisticsCcListData.name = name;
  }
  final String? takerName = jsonConvert.convert<String>(json['takerName']);
  if (takerName != null) {
    userStatisticsCcListData.takerName = takerName;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    userStatisticsCcListData.mobile = mobile;
  }
  final String? orderTime = jsonConvert.convert<String>(json['orderTime']);
  if (orderTime != null) {
    userStatisticsCcListData.orderTime = orderTime;
  }
  final int? orderType = jsonConvert.convert<int>(json['orderType']);
  if (orderType != null) {
    userStatisticsCcListData.orderType = orderType;
  }
  final String? payTime = jsonConvert.convert<String>(json['payTime']);
  if (payTime != null) {
    userStatisticsCcListData.payTime = payTime;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    userStatisticsCcListData.status = status;
  }
  final String? orderName = jsonConvert.convert<String>(json['orderName']);
  if (orderName != null) {
    userStatisticsCcListData.orderName = orderName;
  }
  final String? content = jsonConvert.convert<String>(json['content']);
  if (content != null) {
    userStatisticsCcListData.content = content;
  }
  final double? orderAmount = jsonConvert.convert<double>(json['orderAmount']);
  if (orderAmount != null) {
    userStatisticsCcListData.orderAmount = orderAmount;
  }
  final double? userAmount = jsonConvert.convert<double>(json['userAmount']);
  if (userAmount != null) {
    userStatisticsCcListData.userAmount = userAmount;
  }
  final String? discount = jsonConvert.convert<String>(json['discount']);
  if (discount != null) {
    userStatisticsCcListData.discount = discount;
  }
  final int? applyStatus = jsonConvert.convert<int>(json['applyStatus']);
  if (applyStatus != null) {
    userStatisticsCcListData.applyStatus = applyStatus;
  }
  final int? applyId = jsonConvert.convert<int>(json['applyId']);
  if (applyId != null) {
    userStatisticsCcListData.applyId = applyId;
  }
  return userStatisticsCcListData;
}

Map<String, dynamic> $UserStatisticsCcListDataToJson(
    UserStatisticsCcListData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createdAt'] = entity.createdAt;
  data['updatedAt'] = entity.updatedAt;
  data['id'] = entity.id;
  data['type'] = entity.type;
  data['orgId'] = entity.orgId;
  data['uid'] = entity.uid;
  data['taker'] = entity.taker;
  data['name'] = entity.name;
  data['takerName'] = entity.takerName;
  data['mobile'] = entity.mobile;
  data['orderTime'] = entity.orderTime;
  data['orderType'] = entity.orderType;
  data['payTime'] = entity.payTime;
  data['status'] = entity.status;
  data['orderName'] = entity.orderName;
  data['content'] = entity.content;
  data['orderAmount'] = entity.orderAmount;
  data['userAmount'] = entity.userAmount;
  data['discount'] = entity.discount;
  data['applyStatus'] = entity.applyStatus;
  data['applyId'] = entity.applyId;
  return data;
}

extension UserStatisticsCcListDataExtension on UserStatisticsCcListData {
  UserStatisticsCcListData copyWith({
    int? createdAt,
    int? updatedAt,
    String? id,
    int? type,
    String? orgId,
    String? uid,
    String? taker,
    String? name,
    String? takerName,
    String? mobile,
    String? orderTime,
    int? orderType,
    String? payTime,
    int? status,
    String? orderName,
    String? content,
    double? orderAmount,
    double? userAmount,
    String? discount,
    int? applyStatus,
    int? applyId,
  }) {
    return UserStatisticsCcListData()
      ..createdAt = createdAt ?? this.createdAt
      ..updatedAt = updatedAt ?? this.updatedAt
      ..id = id ?? this.id
      ..type = type ?? this.type
      ..orgId = orgId ?? this.orgId
      ..uid = uid ?? this.uid
      ..taker = taker ?? this.taker
      ..name = name ?? this.name
      ..takerName = takerName ?? this.takerName
      ..mobile = mobile ?? this.mobile
      ..orderTime = orderTime ?? this.orderTime
      ..orderType = orderType ?? this.orderType
      ..payTime = payTime ?? this.payTime
      ..status = status ?? this.status
      ..orderName = orderName ?? this.orderName
      ..content = content ?? this.content
      ..orderAmount = orderAmount ?? this.orderAmount
      ..userAmount = userAmount ?? this.userAmount
      ..discount = discount ?? this.discount
      ..applyStatus = applyStatus ?? this.applyStatus
      ..applyId = applyId ?? this.applyId;
  }
}